<template>
    <div class="child">
        <h3>子组件</h3>
        <p>玩具：{{ toy }}</p>
        <p>接收父组件的传值： {{ car }}</p>
        <el-button type="success" @click="sendToy(toy)">把玩具给父组件</el-button>
    </div>
</template>

<script lang="ts" setup name="Child">
import { ref } from 'vue';

let toy = ref('奥特曼')

defineProps(['car','sendToy'])
</script>

<style scoped>
.child{
    background-color: orange;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 10px black;
}
</style>